package com.hfjava.practice04;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: com.hfjava.practice04
 * @ClassName: TwoColorBall
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/21 9:41
 * @Copyright 大牛版板所有
 */
public class TwoColorBall {
    public static void main(String[] args) {
        List<Integer> redBall = new ArrayList<>();
        System.out.print("红色球号码为：");
        while (redBall.size() < 6){
            int random = (int) (Math.random()*33+1);
            if (!(redBall.contains(random))){
                redBall.add(random);
                System.out.print(random+"\t");
            }
        }
        int blueBall = (int) (Math.random()*16+1);
        System.out.println("\n蓝色球号码为："+blueBall);

        System.out.println("============================================");
        System.out.println("双色球预测号为：");
        for (int i = 0; i < redBall.size(); i++) {
            System.out.print(redBall.get(i)+",");
        }
        System.out.print(" + "+blueBall+"\n");
        System.out.println("\n祝你早日中大奖！");
    }
}
